/*
   Zii EGGxplorer - A simple Zii file browser

   Copyright (C) 2009 - 2010 Claudio Corti

   Header file for EGGxplorer class, derived from CSkinApp; required for application to run.
*/

#ifndef _EGGXPLORER_H_
#define _EGGXPLORER_H_

// Plaszma library
#include <skin.h>

// Application headers
#include "MainWindow.h"

#define DISPLAY_ID   0   // 0 for primary display (internal LCD); 1 for HD TV
#define LOCALE_SIZE 10   // Size of language code string + 1 for nul

// Custom class for main application loop, derived from a simple graphical app
class EGGxplorer : public CSkinApp
{
public:
   // Singleton access to the application
   static EGGxplorer* GetApplication();

   // Destructor
   ~EGGxplorer();

protected:
   // Protected constructor: for singleton implementation
   EGGxplorer();

   // Called when the application call Run (redefinition of virtual function)
   bool OnRun();

   // Called whenever a child window is deleted (redefinition of virtual function)
   void OnDeleteChildWindow(CSkinWindow *);

   // Called when the application stops (redefinition of virtual function)
   void OnStop();

   // Called when the orientation changes (redefinition of virtual function)
   //void OnOrientationChange(RotationType);

   // Handle SD insertion/removal notify
   EventReturnType OnUserEvent(SharedEventPtr, EventType, SharedEventDataPtr);

private:
   // Create the GUI based on the rotation of the Zii
   bool create_gui(RotationType);

   CResourceStudio    *res_factory;     // Resource studio object: handles resources files
   CResource          *string_res;      // String resources: a single string resource file
   CResource          *image_res;       // Image resources: a single image resource file
   CLayoutStudio      *layout_studio;   // Main layout Studio object
   CLayoutSkinFactory *skin_factory;    // Factory for standard Skin widgets

   MainWindow         *main_window;     // Main application window

   DispatcherListenerObj* desktop_observer; // Dekstop observer for events
};

#endif   /* _EGGXPLORER_H_ */
